#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
    int a, b, c, s;
    scanf("%d", &s);
    a = s / 3600;
    b = (s % 3600) / 60;
    c = s % 60;
    printf("%d %d %d\n", a, b, c);
    return 0;
}